﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;

namespace RSentence
{
    public partial class Setting : Form
    {
        public Setting()
        {
            InitializeComponent();
        }

        private void Setting_FormClosed(object sender, FormClosedEventArgs e)
        {
            Properties.Settings.Default.Opacity = 
                Convert.ToDouble(opacityNumber.Value / 100);
            Properties.Settings.Default.Save();
            MessageBox.Show("已保存，即将重启。");
            Process.Start("RSentence.exe");
            Application.Exit();
        }

        private void Setting_Load(object sender, EventArgs e)
        {
            opacityNumber.Value = Convert.ToDecimal(Properties.Settings.Default.Opacity * 100);
        }
    }
}
